<html>
<head><meta charset="utf-8"><title>Using external C library · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Using.20external.20C.20library.html">Using external C library</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="205521344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Using%20external%20C%20library/near/205521344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bob Smith <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Using.20external.20C.20library.html#205521344">(Jul 30 2020 at 19:23)</a>:</h4>
<p>Hello. is there a way to configure a dependency ? My problem:<br>
I add the dependency in Cargo.toml<br>
I can: cargo run my project<br>
BUT I need to configure the dependency ... 2 options: 1) with a parameter during the build phase 2) by editing a config.h inside the dependency.<br>
I am lost because everything is done "automatically".<br>
Any way to do that ?</p>



<a name="205532118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Using%20external%20C%20library/near/205532118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bob Smith <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Using.20external.20C.20library.html#205532118">(Jul 30 2020 at 21:02)</a>:</h4>
<p>or another way to ask is. I created a <a href="http://build.rs">build.rs</a> to "link" the library.<br>
    println!("cargo:rustc-link-search=native={}", out_dir);<br>
    println!("cargo:rustc-link-lib=static=raylib");<br>
so that I can compile it by myself on the side. The problem is that when I compile rust my <a href="http://main.rs">main.rs</a> has errors:<br>
error[E0433]: failed to resolve: use of undeclared type or module <code>raylib</code> (and everywhere else). any idea ?</p>



<a name="205545091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Using%20external%20C%20library/near/205545091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bob Smith <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Using.20external.20C.20library.html#205545091">(Jul 30 2020 at 23:42)</a>:</h4>
<p>ok found it .... nvm</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>